package com.aiyige.model.request;

import com.aiyige.base.api.ApiManager;

import okhttp3.ResponseBody;
import retrofit2.Call;

/**
 * Created by zhuyakun on 2017/12/11.
 */

public class SearchByTypeRequest {
    public static final int TYPE_DYNAMIC = 99;
    public static final int TYPE_LEARN_VIDEO = 5;
    public static final int TYPE_MAJOR_COURSE = 6;
    public static final int TYPE_TRAING_CARD = 7;
    public static final int TYPE_PERSONAL_TRAINER = 8;
    public static final int TYPE_UNIVERSAL_PRODUCT = 9;
    public static final int TYPE_CLASSROOM_RENTAL = 10;
    int type;
    String keyword;

    private SearchByTypeRequest(Builder builder) {
        setType(builder.type);
        setKeyword(builder.keyword);
    }

    public static Builder newBuilder() {
        return new Builder();
    }

    public int getType() {
        return type;
    }

    public void setType(int type) {
        this.type = type;
    }

    public String getKeyword() {
        return keyword;
    }

    public void setKeyword(String keyword) {
        this.keyword = keyword;
    }


    public static final class Builder {
        private int type;
        private String keyword;

        private Builder() {
        }

        public Builder type(int type) {
            this.type = type;
            return this;
        }

        public Builder keyword(String keyword) {
            this.keyword = keyword;
            return this;
        }

        public Call<ResponseBody> build() {
            return ApiManager.getService().searchByType(new SearchByTypeRequest(this));
        }
    }
}
